package com.crr.bean;

import com.crr.common.group.ISave;
import com.crr.common.group.IUpdate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("部门")
public class Dept {
    @ApiModelProperty(name = "id",value = "部门id")
    @NotNull(message = "ID不能为空",groups = {IUpdate.class})
    Integer id;
    @ApiModelProperty(name = "deptCode",value = "部门号码",hidden = true)
    String deptCode;
    @ApiModelProperty(name = "name",value = "部门名",required = true)
    @NotBlank(message = "部门名称不能为空",groups = {ISave.class, IUpdate.class})
    String name;
    @ApiModelProperty(name = "status",value = "状态")
    int status;
    @ApiModelProperty(name = "parentId",value = "上级部门id，顶级为0",required = true)
    int parentId;
}
